//
//  ViewController.m
//  Mp4Writer
//
//  Created by zjp on 2021/8/23.
//

#import "ViewController.h"
#import "MainViewController.h"
#import "RoomData.h"

@interface ViewController ()
@property (weak, nonatomic) IBOutlet UITextField *roomidEdit;
@property (weak, nonatomic) IBOutlet UITextField *useridEdit;

@end

@implementation ViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
    
    int num = arc4random()%100000;
    self.useridEdit.text = [NSString stringWithFormat:@"%d", num];
    _roomidEdit.text = @"911";
}

- (IBAction)onClickEnterRoom:(id)sender {
    [RoomData sharedInstance].roomid = _roomidEdit.text;
    [RoomData sharedInstance].userid = _useridEdit.text;

    UIStoryboard* storyBoard = [UIStoryboard storyboardWithName:@"Main" bundle:nil];
    MainViewController* vc = [storyBoard instantiateViewControllerWithIdentifier:@"MainViewController"];
    [self.navigationController pushViewController:vc animated:NO];

    NSLog(@"onClickEnterRoom");
}

@end
